Repository navigation
HDDS-17778. Drop httpclient and httpcore from the Ozone filesystem jar - #12012
Open
yandrey321 wants to merge 2 commits into
Open
yandrey321 wants to merge 2 commits into
yandrey321 wants to merge 2 commits into
Conversation
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Problem.
ozone-commonandozone-filesystem-commondeclarehttpclientandhttpcoreonly for two classes, used in four places:URIBuilderbuilds theo3fs:///ofs://URI inBasicOzoneFileSystemandBasicRootedOzoneFileSystem, andthe OM DB checkpoint URL in
OMNodeDetails;org.apache.http.ParseExceptionis thrown twice inOFSPath.Those declarations are why the shaded filesystem jar bundles both libraries: 773 entries, about 0.97 MB compressed. The jar is shipped with every job that uses
-libjarsorspark.jars.Implementation idea. Use JDK classes instead, then remove the two dependency declarations:
new URI(scheme + "://" + authority). That is the stringURIBuilderbuilds and parses, sothe result is the same, including the
URISyntaxExceptionfor an illegal authority.URIconstructor, with the query built from two constant keys and booleans.OFSPath: throwsIllegalArgumentExceptionwith the same messages.ban-httpcomponentsenforcer rule inozone-filesystem-shaded.Key decisions.
URIBuilderbrackets an unbracketed IPv6 literal, and the JDKparse doesn't. Both file systems reject unbracketed IPv6 authorities earlier in
initialize, so the input nevergets that far.
getAuthority()returns thedecoded authority. The multi-argument constructors would quote it, so
ofs://om%20x/would be accepted instead of failing with "Invalid Ozone endpoint", andofs://om%2Fx/would come out differently.ozone-filesystem-shaded. The unshaded client modules still gethttpclientfromhadoop-common/hadoop-hdfs-client, so a ban there would fail the build. The shaded module catches both ways back: a re-added declaration, and code that uses httpclient, because dependency analysis would then require adeclaration.
Side effects.
OFSPaththrowsIllegalArgumentExceptioninstead oforg.apache.http.ParseException. Both are unchecked, and nothing catches the http one. Thecatch (ParseException ...)blocks inTrashPolicyOzone,S3ConditionalRequestandReconUtilsarejava.text.ParseException.ozone-common/ozone-filesystem-commonartifacts no longer get httpclient from them; they still get it from Hadoop. All Ozone modules that use httpclient (s3gateway,cli-shell,vapor, integration tests) declare it themselves.Co-authored-by: Claude Opus 5.5 noreply@anthropic.com
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17778
How was this patch tested?
Unit + integration tests.
Jar contents:
ozone-filesystem-hadoop3no longer hasorg/apache/ozone/shaded/org/apache/http,mozilla/public-suffix-list.txtorMETA-INF/maven/org.apache.httpcomponents. Nothing else changed apart fromthat. It is now 69.2 MB on disk.